package com.framework.ACore;

import com.framerock.baselib.Rock;

import java.util.Map;

/**
 * 单据通知模型
 * */
public class ModuleTodo {

    private String num = "", name = "",summary = "",wherena="",wherelx = "",acttype = "",tofields="";

    private int toaid = 0;

    /**
     * 创建一个单据通知模型
     * @param num 编号
     * */
    public static ModuleTodo get(String num)
    {
        return new ModuleTodo().setNum(num);
    }

    /**
     * 设置编号，需要此模块唯一
     * */
    public ModuleTodo setNum(String num) {
        this.num = num;
        return this;
    }

    /**
     * 通知标题
     * */
    public ModuleTodo setName(String name) {
        this.name = name;
        return this;
    }

    /**
     * 通知内容
     * */
    public ModuleTodo setSummary(String summary) {
        this.summary = summary;
        return this;
    }

    /**
     * 触发类型：turn|提交时,edit|编辑时,delete|删除时,zuofei|作废时,finish|审批完成时,task|定时计划任务,ping|评论时
     * */
    public ModuleTodo setActtype(String acttype) {
        this.acttype = acttype;
        return this;
    }

    /**
     * 要通知对应字段
     * */
    public ModuleTodo setTofields(String tofields) {
        this.tofields = tofields;
        return this;
    }

    /**
     * 触发条件编号
     * */
    public ModuleTodo setWherelx(String wherelx) {
        this.wherelx = wherelx;
        return this;
    }

    /**
     * 触发条件名称
     * */
    public ModuleTodo setWherena(String wherena) {
        this.wherena = wherena;
        return this;
    }

    /**
     * 是否通知所属人
     * */
    public ModuleTodo setToaid(int toaid) {
        this.toaid = toaid;
        return this;
    }

    /**
     * 获取
     * */
    public Map<String, String> getMap()
    {
        Map<String, String> da = Rock.getMap();
        da.put("num", this.num);
        da.put("name", this.name);
        da.put("summary", this.summary);
        da.put("wherena", this.wherena);
        da.put("wherelx", this.wherelx);
        da.put("acttype", this.acttype);
        da.put("tofields", this.tofields);
        da.put("toaid", this.toaid+"");
        return da;
    }
}
